/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('avds', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddAssetTagsRequest {
  assets?: [ string ](name='Assets'),
  lang?: string(name='Lang'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceIp?: string(name='SourceIp'),
  tags?: [ string ](name='Tags'),
}

model AddAssetTagsResponseBody = {
  requestId?: string(name='RequestId'),
}

model AddAssetTagsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddAssetTagsResponseBody(name='body'),
}

async function addAssetTagsWithOptions(request: AddAssetTagsRequest, runtime: Util.RuntimeOptions): AddAssetTagsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.assets)) {
    query['Assets'] = request.assets;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddAssetTags',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addAssetTags(request: AddAssetTagsRequest): AddAssetTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return addAssetTagsWithOptions(request, runtime);
}

model AddAssetsRequest {
  assets?: [ string ](name='Assets'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceIp?: string(name='SourceIp'),
  tags?: [ string ](name='Tags'),
}

model AddAssetsResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddAssetsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddAssetsResponseBody(name='body'),
}

async function addAssetsWithOptions(request: AddAssetsRequest, runtime: Util.RuntimeOptions): AddAssetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.assets)) {
    query['Assets'] = request.assets;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddAssets',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addAssets(request: AddAssetsRequest): AddAssetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return addAssetsWithOptions(request, runtime);
}

model AddOrgDomainsRequest {
  domains?: [ string ](name='Domains'),
  orgId?: int32(name='OrgId'),
}

model AddOrgDomainsResponseBody = {
  requestId?: string(name='RequestId'),
}

model AddOrgDomainsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddOrgDomainsResponseBody(name='body'),
}

async function addOrgDomainsWithOptions(request: AddOrgDomainsRequest, runtime: Util.RuntimeOptions): AddOrgDomainsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domains)) {
    query['Domains'] = request.domains;
  }
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddOrgDomains',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addOrgDomains(request: AddOrgDomainsRequest): AddOrgDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return addOrgDomainsWithOptions(request, runtime);
}

model AddOrgHostsRequest {
  hosts?: [ string ](name='Hosts'),
  orgId?: int32(name='OrgId'),
}

model AddOrgHostsResponseBody = {
  requestId?: string(name='RequestId'),
}

model AddOrgHostsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddOrgHostsResponseBody(name='body'),
}

async function addOrgHostsWithOptions(request: AddOrgHostsRequest, runtime: Util.RuntimeOptions): AddOrgHostsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.hosts)) {
    query['Hosts'] = request.hosts;
  }
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddOrgHosts',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addOrgHosts(request: AddOrgHostsRequest): AddOrgHostsResponse {
  var runtime = new Util.RuntimeOptions{};
  return addOrgHostsWithOptions(request, runtime);
}

model AddOrgSubdomainsRequest {
  orgId?: int32(name='OrgId'),
  subdomains?: [ string ](name='Subdomains'),
}

model AddOrgSubdomainsResponseBody = {
  requestId?: string(name='RequestId'),
}

model AddOrgSubdomainsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddOrgSubdomainsResponseBody(name='body'),
}

async function addOrgSubdomainsWithOptions(request: AddOrgSubdomainsRequest, runtime: Util.RuntimeOptions): AddOrgSubdomainsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.subdomains)) {
    query['Subdomains'] = request.subdomains;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddOrgSubdomains',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addOrgSubdomains(request: AddOrgSubdomainsRequest): AddOrgSubdomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return addOrgSubdomainsWithOptions(request, runtime);
}

model AddOrgWebPathsRequest {
  orgId?: int32(name='OrgId'),
  URLs?: [ string ](name='URLs'),
}

model AddOrgWebPathsResponseBody = {
  requestId?: string(name='RequestId'),
}

model AddOrgWebPathsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddOrgWebPathsResponseBody(name='body'),
}

async function addOrgWebPathsWithOptions(request: AddOrgWebPathsRequest, runtime: Util.RuntimeOptions): AddOrgWebPathsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.URLs)) {
    query['URLs'] = request.URLs;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddOrgWebPaths',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addOrgWebPaths(request: AddOrgWebPathsRequest): AddOrgWebPathsResponse {
  var runtime = new Util.RuntimeOptions{};
  return addOrgWebPathsWithOptions(request, runtime);
}

model CreateOrganizationRequest {
  description?: string(name='Description'),
  domains?: [ string ](name='Domains'),
  name?: string(name='Name'),
}

model CreateOrganizationResponseBody = {
  requestId?: string(name='RequestId'),
}

model CreateOrganizationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateOrganizationResponseBody(name='body'),
}

async function createOrganizationWithOptions(request: CreateOrganizationRequest, runtime: Util.RuntimeOptions): CreateOrganizationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.domains)) {
    query['Domains'] = request.domains;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateOrganization',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createOrganization(request: CreateOrganizationRequest): CreateOrganizationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createOrganizationWithOptions(request, runtime);
}

model CreateSessionRequest {
  asset?: string(name='Asset'),
  loginSession?: string(name='LoginSession'),
  TTL?: int32(name='TTL'),
}

model CreateSessionResponseBody = {
  requestId?: string(name='RequestId'),
}

model CreateSessionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSessionResponseBody(name='body'),
}

async function createSessionWithOptions(request: CreateSessionRequest, runtime: Util.RuntimeOptions): CreateSessionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.loginSession)) {
    query['LoginSession'] = request.loginSession;
  }
  if (!Util.isUnset(request.TTL)) {
    query['TTL'] = request.TTL;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSession',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSession(request: CreateSessionRequest): CreateSessionResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSessionWithOptions(request, runtime);
}

model DeleteAssetsRequest {
  assetIds?: [ string ](name='AssetIds'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceIp?: string(name='SourceIp'),
}

model DeleteAssetsResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteAssetsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAssetsResponseBody(name='body'),
}

async function deleteAssetsWithOptions(request: DeleteAssetsRequest, runtime: Util.RuntimeOptions): DeleteAssetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.assetIds)) {
    query['AssetIds'] = request.assetIds;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAssets',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAssets(request: DeleteAssetsRequest): DeleteAssetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAssetsWithOptions(request, runtime);
}

model DeleteOrgAttackSurfaceRecordsRequest {
  orgId?: int32(name='OrgId'),
  records?: [ int32 ](name='Records'),
  source?: string(name='Source'),
}

model DeleteOrgAttackSurfaceRecordsResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteOrgAttackSurfaceRecordsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteOrgAttackSurfaceRecordsResponseBody(name='body'),
}

async function deleteOrgAttackSurfaceRecordsWithOptions(request: DeleteOrgAttackSurfaceRecordsRequest, runtime: Util.RuntimeOptions): DeleteOrgAttackSurfaceRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.records)) {
    query['Records'] = request.records;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteOrgAttackSurfaceRecords',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteOrgAttackSurfaceRecords(request: DeleteOrgAttackSurfaceRecordsRequest): DeleteOrgAttackSurfaceRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteOrgAttackSurfaceRecordsWithOptions(request, runtime);
}

model DeleteOrganizationsRequest {
  orgIds?: [ string ](name='OrgIds'),
}

model DeleteOrganizationsResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteOrganizationsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteOrganizationsResponseBody(name='body'),
}

async function deleteOrganizationsWithOptions(request: DeleteOrganizationsRequest, runtime: Util.RuntimeOptions): DeleteOrganizationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orgIds)) {
    query['OrgIds'] = request.orgIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteOrganizations',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteOrganizations(request: DeleteOrganizationsRequest): DeleteOrganizationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteOrganizationsWithOptions(request, runtime);
}

model DeleteSessionRequest {
  sessionId?: int32(name='SessionId'),
}

model DeleteSessionResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteSessionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSessionResponseBody(name='body'),
}

async function deleteSessionWithOptions(request: DeleteSessionRequest, runtime: Util.RuntimeOptions): DeleteSessionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSession',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSession(request: DeleteSessionRequest): DeleteSessionResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSessionWithOptions(request, runtime);
}

model DeleteUserAttackSurfaceRecordsRequest {
  records?: [ int32 ](name='Records'),
  source?: string(name='Source'),
}

model DeleteUserAttackSurfaceRecordsResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteUserAttackSurfaceRecordsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteUserAttackSurfaceRecordsResponseBody(name='body'),
}

async function deleteUserAttackSurfaceRecordsWithOptions(request: DeleteUserAttackSurfaceRecordsRequest, runtime: Util.RuntimeOptions): DeleteUserAttackSurfaceRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.records)) {
    query['Records'] = request.records;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUserAttackSurfaceRecords',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteUserAttackSurfaceRecords(request: DeleteUserAttackSurfaceRecordsRequest): DeleteUserAttackSurfaceRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUserAttackSurfaceRecordsWithOptions(request, runtime);
}

model DescribeAllVulnerabilitiesRequest {
  beginTime?: long(name='BeginTime'),
  category?: string(name='Category'),
  currentPage?: int32(name='CurrentPage'),
  endTime?: long(name='EndTime'),
  lang?: string(name='Lang'),
  module?: string(name='Module'),
  name?: string(name='Name'),
  pageSize?: int32(name='PageSize'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scanId?: string(name='ScanId'),
  search?: string(name='Search'),
  severity?: int32(name='Severity'),
  sourceIp?: string(name='SourceIp'),
  status?: string(name='Status'),
  taskId?: long(name='TaskId'),
  vulType?: long(name='VulType'),
}

model DescribeAllVulnerabilitiesResponseBody = {
  count?: int32(name='Count'),
  currentPage?: int32(name='CurrentPage'),
  list?: [ 
    {
      hostname?: string(name='Hostname'),
      id?: long(name='Id'),
      lastDiscoveredAt?: long(name='LastDiscoveredAt'),
      name?: string(name='Name'),
      severity?: int32(name='Severity'),
      status?: int32(name='Status'),
      target?: string(name='Target'),
      taskId?: long(name='TaskId'),
      vulnerabilityTypeDes?: string(name='VulnerabilityTypeDes'),
    }
  ](name='List'),
  pageCount?: int32(name='PageCount'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeAllVulnerabilitiesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAllVulnerabilitiesResponseBody(name='body'),
}

async function describeAllVulnerabilitiesWithOptions(request: DescribeAllVulnerabilitiesRequest, runtime: Util.RuntimeOptions): DescribeAllVulnerabilitiesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.module)) {
    query['Module'] = request.module;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scanId)) {
    query['ScanId'] = request.scanId;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  if (!Util.isUnset(request.severity)) {
    query['Severity'] = request.severity;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.vulType)) {
    query['VulType'] = request.vulType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAllVulnerabilities',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAllVulnerabilities(request: DescribeAllVulnerabilitiesRequest): DescribeAllVulnerabilitiesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAllVulnerabilitiesWithOptions(request, runtime);
}

model DescribeAssetsRequest {
  assets?: [ string ](name='Assets'),
  currentPage?: int32(name='CurrentPage'),
  gmtCreateFrom?: long(name='GmtCreateFrom'),
  gmtCreateTo?: long(name='GmtCreateTo'),
  pageSize?: int32(name='PageSize'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  search?: string(name='Search'),
  source?: string(name='Source'),
  sourceIp?: string(name='SourceIp'),
  status?: string(name='Status'),
  types?: [ string ](name='Types'),
}

model DescribeAssetsResponseBody = {
  count?: int32(name='Count'),
  currentPage?: int32(name='CurrentPage'),
  list?: [ 
    {
      asset?: string(name='Asset'),
      assetId?: string(name='AssetId'),
      expireTime?: long(name='ExpireTime'),
      gmtCreate?: long(name='GmtCreate'),
      lastScanDate?: long(name='LastScanDate'),
      source?: string(name='Source'),
      type?: string(name='Type'),
    }
  ](name='List'),
  pageCount?: int32(name='PageCount'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeAssetsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAssetsResponseBody(name='body'),
}

async function describeAssetsWithOptions(request: DescribeAssetsRequest, runtime: Util.RuntimeOptions): DescribeAssetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.assets)) {
    query['Assets'] = request.assets;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.gmtCreateFrom)) {
    query['GmtCreateFrom'] = request.gmtCreateFrom;
  }
  if (!Util.isUnset(request.gmtCreateTo)) {
    query['GmtCreateTo'] = request.gmtCreateTo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.types)) {
    query['Types'] = request.types;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAssets',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAssets(request: DescribeAssetsRequest): DescribeAssetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAssetsWithOptions(request, runtime);
}

model DescribeAttackSurfacesFacetsRequest {
  taskId?: int32(name='TaskId'),
}

model DescribeAttackSurfacesFacetsResponseBody = {
  crawlerRequests?: int32(name='CrawlerRequests'),
  DNSMap?: int32(name='DNSMap'),
  domains?: int32(name='Domains'),
  hosts?: int32(name='Hosts'),
  ports?: int32(name='Ports'),
  requestId?: string(name='RequestId'),
  subdomains?: int32(name='Subdomains'),
  webPaths?: int32(name='WebPaths'),
  webServers?: int32(name='WebServers'),
  webTechs?: int32(name='WebTechs'),
}

model DescribeAttackSurfacesFacetsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAttackSurfacesFacetsResponseBody(name='body'),
}

async function describeAttackSurfacesFacetsWithOptions(request: DescribeAttackSurfacesFacetsRequest, runtime: Util.RuntimeOptions): DescribeAttackSurfacesFacetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAttackSurfacesFacets',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAttackSurfacesFacets(request: DescribeAttackSurfacesFacetsRequest): DescribeAttackSurfacesFacetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAttackSurfacesFacetsWithOptions(request, runtime);
}

model DescribeCrawlerRequestsRequest {
  asset?: string(name='Asset'),
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  taskId?: int32(name='TaskId'),
}

model DescribeCrawlerRequestsResponseBody = {
  records?: [ 
    {
      cookies?: string(name='Cookies'),
      data?: string(name='Data'),
      index?: int32(name='Index'),
      method?: string(name='Method'),
      URL?: string(name='URL'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  total?: int32(name='Total'),
}

model DescribeCrawlerRequestsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeCrawlerRequestsResponseBody(name='body'),
}

async function describeCrawlerRequestsWithOptions(request: DescribeCrawlerRequestsRequest, runtime: Util.RuntimeOptions): DescribeCrawlerRequestsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCrawlerRequests',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeCrawlerRequests(request: DescribeCrawlerRequestsRequest): DescribeCrawlerRequestsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCrawlerRequestsWithOptions(request, runtime);
}

model DescribeDNSMapRequest {
  asset?: string(name='Asset'),
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  taskId?: int32(name='TaskId'),
}

model DescribeDNSMapResponseBody = {
  records?: [ 
    {
      domain?: string(name='Domain'),
      index?: int32(name='Index'),
      record?: string(name='Record'),
      type?: string(name='Type'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  total?: int32(name='Total'),
}

model DescribeDNSMapResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeDNSMapResponseBody(name='body'),
}

async function describeDNSMapWithOptions(request: DescribeDNSMapRequest, runtime: Util.RuntimeOptions): DescribeDNSMapResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDNSMap',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeDNSMap(request: DescribeDNSMapRequest): DescribeDNSMapResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDNSMapWithOptions(request, runtime);
}

model DescribeDomainAttackSurfacesFacetsRequest {
  domain?: string(name='Domain'),
  taskId?: int32(name='TaskId'),
}

model DescribeDomainAttackSurfacesFacetsResponseBody = {
  crawlerRequests?: int32(name='CrawlerRequests'),
  requestId?: string(name='RequestId'),
  webPaths?: int32(name='WebPaths'),
  webServers?: int32(name='WebServers'),
  webTechs?: int32(name='WebTechs'),
}

model DescribeDomainAttackSurfacesFacetsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeDomainAttackSurfacesFacetsResponseBody(name='body'),
}

async function describeDomainAttackSurfacesFacetsWithOptions(request: DescribeDomainAttackSurfacesFacetsRequest, runtime: Util.RuntimeOptions): DescribeDomainAttackSurfacesFacetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomainAttackSurfacesFacets',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeDomainAttackSurfacesFacets(request: DescribeDomainAttackSurfacesFacetsRequest): DescribeDomainAttackSurfacesFacetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainAttackSurfacesFacetsWithOptions(request, runtime);
}

model DescribeDomainsRequest {
  asset?: string(name='Asset'),
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  taskId?: int32(name='TaskId'),
}

model DescribeDomainsResponseBody = {
  records?: [ 
    {
      domain?: string(name='Domain'),
      index?: int32(name='Index'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  total?: int32(name='Total'),
}

model DescribeDomainsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeDomainsResponseBody(name='body'),
}

async function describeDomainsWithOptions(request: DescribeDomainsRequest, runtime: Util.RuntimeOptions): DescribeDomainsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomains',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeDomains(request: DescribeDomainsRequest): DescribeDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainsWithOptions(request, runtime);
}

model DescribeHostAttackSurfacesFacetsRequest {
  host?: string(name='Host'),
  taskId?: int32(name='TaskId'),
}

model DescribeHostAttackSurfacesFacetsResponseBody = {
  crawlerRequests?: int32(name='CrawlerRequests'),
  hosts?: int32(name='Hosts'),
  ports?: int32(name='Ports'),
  requestId?: string(name='RequestId'),
  webPaths?: int32(name='WebPaths'),
  webTechs?: int32(name='WebTechs'),
}

model DescribeHostAttackSurfacesFacetsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeHostAttackSurfacesFacetsResponseBody(name='body'),
}

async function describeHostAttackSurfacesFacetsWithOptions(request: DescribeHostAttackSurfacesFacetsRequest, runtime: Util.RuntimeOptions): DescribeHostAttackSurfacesFacetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.host)) {
    query['Host'] = request.host;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHostAttackSurfacesFacets',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeHostAttackSurfacesFacets(request: DescribeHostAttackSurfacesFacetsRequest): DescribeHostAttackSurfacesFacetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHostAttackSurfacesFacetsWithOptions(request, runtime);
}

model DescribeHostsRequest {
  asset?: string(name='Asset'),
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  taskId?: int32(name='TaskId'),
}

model DescribeHostsResponseBody = {
  records?: [ 
    {
      hostname?: string(name='Hostname'),
      IP?: string(name='IP'),
      index?: int32(name='Index'),
      isUp?: string(name='IsUp'),
      OS?: string(name='OS'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  total?: int32(name='Total'),
}

model DescribeHostsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeHostsResponseBody(name='body'),
}

async function describeHostsWithOptions(request: DescribeHostsRequest, runtime: Util.RuntimeOptions): DescribeHostsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHosts',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeHosts(request: DescribeHostsRequest): DescribeHostsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHostsWithOptions(request, runtime);
}

model DescribeListSessionsRequest {
  asset?: string(name='Asset'),
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
}

model DescribeListSessionsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  sessions?: [ 
    {
      aliUid?: int32(name='AliUid'),
      asset?: string(name='Asset'),
      createdAt?: long(name='CreatedAt'),
      expired?: int32(name='Expired'),
      loginSession?: string(name='LoginSession'),
      modifiedAt?: long(name='ModifiedAt'),
      sessionId?: int32(name='SessionId'),
      TTL?: int32(name='TTL'),
    }
  ](name='Sessions'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeListSessionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeListSessionsResponseBody(name='body'),
}

async function describeListSessionsWithOptions(request: DescribeListSessionsRequest, runtime: Util.RuntimeOptions): DescribeListSessionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeListSessions',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeListSessions(request: DescribeListSessionsRequest): DescribeListSessionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeListSessionsWithOptions(request, runtime);
}

model DescribeOrgAttackSurfaceDetailsRequest {
  orgId?: int32(name='OrgId'),
  recordId?: int32(name='RecordId'),
  source?: string(name='Source'),
}

model DescribeOrgAttackSurfaceDetailsResponseBody = {
  firstScannedAt?: long(name='FirstScannedAt'),
  lastScannedAt?: long(name='LastScannedAt'),
  occurrences?: int32(name='Occurrences'),
  requestId?: string(name='RequestId'),
}

model DescribeOrgAttackSurfaceDetailsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeOrgAttackSurfaceDetailsResponseBody(name='body'),
}

async function describeOrgAttackSurfaceDetailsWithOptions(request: DescribeOrgAttackSurfaceDetailsRequest, runtime: Util.RuntimeOptions): DescribeOrgAttackSurfaceDetailsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.recordId)) {
    query['RecordId'] = request.recordId;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOrgAttackSurfaceDetails',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeOrgAttackSurfaceDetails(request: DescribeOrgAttackSurfaceDetailsRequest): DescribeOrgAttackSurfaceDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOrgAttackSurfaceDetailsWithOptions(request, runtime);
}

model DescribeOrgInfoRequest {
  orgId?: int32(name='OrgId'),
}

model DescribeOrgInfoResponseBody = {
  aliUid?: long(name='AliUid'),
  createdAt?: long(name='CreatedAt'),
  description?: string(name='Description'),
  name?: string(name='Name'),
  orgId?: int32(name='OrgId'),
  requestId?: string(name='RequestId'),
}

model DescribeOrgInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeOrgInfoResponseBody(name='body'),
}

async function describeOrgInfoWithOptions(request: DescribeOrgInfoRequest, runtime: Util.RuntimeOptions): DescribeOrgInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOrgInfo',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeOrgInfo(request: DescribeOrgInfoRequest): DescribeOrgInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOrgInfoWithOptions(request, runtime);
}

model DescribePortsRequest {
  asset?: string(name='Asset'),
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  taskId?: int32(name='TaskId'),
}

model DescribePortsResponseBody = {
  records?: [ 
    {
      fingerprint?: string(name='Fingerprint'),
      IP?: string(name='IP'),
      index?: int32(name='Index'),
      port?: string(name='Port'),
      product?: string(name='Product'),
      protocol?: string(name='Protocol'),
      service?: string(name='Service'),
      updatedAt?: long(name='UpdatedAt'),
      version?: string(name='Version'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  total?: int32(name='Total'),
}

model DescribePortsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribePortsResponseBody(name='body'),
}

async function describePortsWithOptions(request: DescribePortsRequest, runtime: Util.RuntimeOptions): DescribePortsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePorts',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describePorts(request: DescribePortsRequest): DescribePortsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePortsWithOptions(request, runtime);
}

model DescribeScanSessionsRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scanId?: string(name='ScanId'),
  search?: string(name='Search'),
  sourceIp?: string(name='SourceIp'),
  statusList?: [ string ](name='StatusList'),
}

model DescribeScanSessionsResponseBody = {
  count?: int32(name='Count'),
  currentPage?: int32(name='CurrentPage'),
  list?: [ 
    {
      createdAt?: long(name='CreatedAt'),
      finishedAt?: long(name='FinishedAt'),
      interval?: int32(name='Interval'),
      jobStatus?: string(name='JobStatus'),
      name?: string(name='Name'),
      period?: string(name='Period'),
      reportStatus?: string(name='ReportStatus'),
      reportUrl?: string(name='ReportUrl'),
      runPercent?: float(name='RunPercent'),
      scanId?: string(name='ScanId'),
      targets?: [ string ](name='Targets'),
      taskId?: long(name='TaskId'),
      triggerType?: string(name='TriggerType'),
    }
  ](name='List'),
  pageCount?: int32(name='PageCount'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeScanSessionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScanSessionsResponseBody(name='body'),
}

async function describeScanSessionsWithOptions(request: DescribeScanSessionsRequest, runtime: Util.RuntimeOptions): DescribeScanSessionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scanId)) {
    query['ScanId'] = request.scanId;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.statusList)) {
    query['StatusList'] = request.statusList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScanSessions',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScanSessions(request: DescribeScanSessionsRequest): DescribeScanSessionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScanSessionsWithOptions(request, runtime);
}

model DescribeSessionRequest {
  sessionId?: int32(name='SessionId'),
}

model DescribeSessionResponseBody = {
  requestId?: string(name='RequestId'),
  session?: {
    aliUid?: int32(name='AliUid'),
    asset?: string(name='Asset'),
    createdAt?: long(name='CreatedAt'),
    expired?: int32(name='Expired'),
    loginSession?: string(name='LoginSession'),
    modifiedAt?: long(name='ModifiedAt'),
    sessionId?: int32(name='SessionId'),
    TTL?: int32(name='TTL'),
  }(name='Session'),
}

model DescribeSessionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSessionResponseBody(name='body'),
}

async function describeSessionWithOptions(request: DescribeSessionRequest, runtime: Util.RuntimeOptions): DescribeSessionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSession',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSession(request: DescribeSessionRequest): DescribeSessionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSessionWithOptions(request, runtime);
}

model DescribeSubdomainsRequest {
  asset?: string(name='Asset'),
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  taskId?: int32(name='TaskId'),
}

model DescribeSubdomainsResponseBody = {
  records?: [ 
    {
      domain?: string(name='Domain'),
      index?: int32(name='Index'),
      rootDomain?: string(name='RootDomain'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  total?: int32(name='Total'),
}

model DescribeSubdomainsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSubdomainsResponseBody(name='body'),
}

async function describeSubdomainsWithOptions(request: DescribeSubdomainsRequest, runtime: Util.RuntimeOptions): DescribeSubdomainsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSubdomains',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSubdomains(request: DescribeSubdomainsRequest): DescribeSubdomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSubdomainsWithOptions(request, runtime);
}

model DescribeUserTagsRequest {
  currentPage?: int32(name='CurrentPage'),
  lang?: string(name='Lang'),
  pageSize?: int32(name='PageSize'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  search?: string(name='Search'),
  sourceIp?: string(name='SourceIp'),
}

model DescribeUserTagsResponseBody = {
  count?: int32(name='Count'),
  currentPage?: int32(name='CurrentPage'),
  list?: [ 
    {
      assetCount?: int32(name='AssetCount'),
      tagKey?: string(name='TagKey'),
    }
  ](name='List'),
  pageCount?: int32(name='PageCount'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeUserTagsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeUserTagsResponseBody(name='body'),
}

async function describeUserTagsWithOptions(request: DescribeUserTagsRequest, runtime: Util.RuntimeOptions): DescribeUserTagsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUserTags',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeUserTags(request: DescribeUserTagsRequest): DescribeUserTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUserTagsWithOptions(request, runtime);
}

model DescribeVulnerabilityRequest {
  id?: long(name='Id'),
  lang?: string(name='Lang'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceIp?: string(name='SourceIp'),
}

model DescribeVulnerabilityResponseBody = {
  args?: string(name='Args'),
  data?: string(name='Data'),
  description?: string(name='Description'),
  hostname?: string(name='Hostname'),
  id?: long(name='Id'),
  impact?: string(name='Impact'),
  lastDiscoveredAt?: long(name='LastDiscoveredAt'),
  name?: string(name='Name'),
  poc?: string(name='Poc'),
  reference?: string(name='Reference'),
  requestId?: string(name='RequestId'),
  severity?: int32(name='Severity'),
  solution?: string(name='Solution'),
  success?: boolean(name='Success'),
  target?: string(name='Target'),
  vulnerability?: {
    args?: string(name='Args'),
    commonType?: string(name='CommonType'),
    cwe?: string(name='Cwe'),
    data?: string(name='Data'),
    description?: string(name='Description'),
    hostname?: string(name='Hostname'),
    id?: long(name='Id'),
    impact?: string(name='Impact'),
    lastDiscoveredAt?: long(name='LastDiscoveredAt'),
    name?: string(name='Name'),
    owasp?: string(name='Owasp'),
    poc?: string(name='Poc'),
    reference?: string(name='Reference'),
    severity?: int32(name='Severity'),
    solution?: string(name='Solution'),
    status?: int32(name='Status'),
    target?: string(name='Target'),
    wasc?: string(name='Wasc'),
  }(name='Vulnerability'),
}

model DescribeVulnerabilityResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeVulnerabilityResponseBody(name='body'),
}

async function describeVulnerabilityWithOptions(request: DescribeVulnerabilityRequest, runtime: Util.RuntimeOptions): DescribeVulnerabilityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeVulnerability',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeVulnerability(request: DescribeVulnerabilityRequest): DescribeVulnerabilityResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeVulnerabilityWithOptions(request, runtime);
}

model DescribeWebPathsRequest {
  asset?: string(name='Asset'),
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  taskId?: int32(name='TaskId'),
}

model DescribeWebPathsResponseBody = {
  records?: [ 
    {
      extension?: string(name='Extension'),
      index?: int32(name='Index'),
      path?: string(name='Path'),
      site?: string(name='Site'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  total?: int32(name='Total'),
}

model DescribeWebPathsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeWebPathsResponseBody(name='body'),
}

async function describeWebPathsWithOptions(request: DescribeWebPathsRequest, runtime: Util.RuntimeOptions): DescribeWebPathsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeWebPaths',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeWebPaths(request: DescribeWebPathsRequest): DescribeWebPathsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeWebPathsWithOptions(request, runtime);
}

model DescribeWebServersRequest {
  asset?: string(name='Asset'),
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  taskId?: int32(name='TaskId'),
}

model DescribeWebServersResponseBody = {
  records?: [ 
    {
      host?: string(name='Host'),
      index?: int32(name='Index'),
      port?: string(name='Port'),
      scheme?: string(name='Scheme'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  total?: int32(name='Total'),
}

model DescribeWebServersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeWebServersResponseBody(name='body'),
}

async function describeWebServersWithOptions(request: DescribeWebServersRequest, runtime: Util.RuntimeOptions): DescribeWebServersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeWebServers',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeWebServers(request: DescribeWebServersRequest): DescribeWebServersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeWebServersWithOptions(request, runtime);
}

model DescribeWebTechsRequest {
  asset?: string(name='Asset'),
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  taskId?: int32(name='TaskId'),
}

model DescribeWebTechsResponseBody = {
  records?: [ 
    {
      index?: int32(name='Index'),
      name?: string(name='Name'),
      poweredBy?: string(name='PoweredBy'),
      server?: string(name='Server'),
      title?: string(name='Title'),
      URL?: string(name='URL'),
      updatedAt?: long(name='UpdatedAt'),
      version?: string(name='Version'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  total?: int32(name='Total'),
}

model DescribeWebTechsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeWebTechsResponseBody(name='body'),
}

async function describeWebTechsWithOptions(request: DescribeWebTechsRequest, runtime: Util.RuntimeOptions): DescribeWebTechsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeWebTechs',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeWebTechs(request: DescribeWebTechsRequest): DescribeWebTechsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeWebTechsWithOptions(request, runtime);
}

model EditSessionRequest {
  asset?: string(name='Asset'),
  loginSession?: string(name='LoginSession'),
  sessionId?: int32(name='SessionId'),
  TTL?: int32(name='TTL'),
}

model EditSessionResponseBody = {
  requestId?: string(name='RequestId'),
}

model EditSessionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EditSessionResponseBody(name='body'),
}

async function editSessionWithOptions(request: EditSessionRequest, runtime: Util.RuntimeOptions): EditSessionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.loginSession)) {
    query['LoginSession'] = request.loginSession;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.TTL)) {
    query['TTL'] = request.TTL;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EditSession',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function editSession(request: EditSessionRequest): EditSessionResponse {
  var runtime = new Util.RuntimeOptions{};
  return editSessionWithOptions(request, runtime);
}

model GenerateVulReportRequest {
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceIp?: string(name='SourceIp'),
  taskIds?: [ string ](name='TaskIds'),
  format?: string(name='format'),
  lang?: string(name='lang'),
}

model GenerateVulReportResponseBody = {
  requestId?: string(name='RequestId'),
}

model GenerateVulReportResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GenerateVulReportResponseBody(name='body'),
}

async function generateVulReportWithOptions(request: GenerateVulReportRequest, runtime: Util.RuntimeOptions): GenerateVulReportResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.taskIds)) {
    query['TaskIds'] = request.taskIds;
  }
  if (!Util.isUnset(request.format)) {
    query['format'] = request.format;
  }
  if (!Util.isUnset(request.lang)) {
    query['lang'] = request.lang;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GenerateVulReport',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function generateVulReport(request: GenerateVulReportRequest): GenerateVulReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateVulReportWithOptions(request, runtime);
}

model ListOrgAttackSurfaceFacetsRequest {
  orgId?: int32(name='OrgId'),
}

model ListOrgAttackSurfaceFacetsResponseBody = {
  DNSMap?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='DNSMap'),
  domains?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='Domains'),
  hosts?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='Hosts'),
  ports?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='Ports'),
  requestId?: string(name='RequestId'),
  subdomains?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='Subdomains'),
  webPaths?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='WebPaths'),
  webTechs?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='WebTechs'),
}

model ListOrgAttackSurfaceFacetsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListOrgAttackSurfaceFacetsResponseBody(name='body'),
}

async function listOrgAttackSurfaceFacetsWithOptions(request: ListOrgAttackSurfaceFacetsRequest, runtime: Util.RuntimeOptions): ListOrgAttackSurfaceFacetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOrgAttackSurfaceFacets',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOrgAttackSurfaceFacets(request: ListOrgAttackSurfaceFacetsRequest): ListOrgAttackSurfaceFacetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOrgAttackSurfaceFacetsWithOptions(request, runtime);
}

model ListOrgDNSMapRequest {
  currentPage?: int32(name='CurrentPage'),
  orgId?: int32(name='OrgId'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListOrgDNSMapResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      domain?: string(name='Domain'),
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      orgId?: int32(name='OrgId'),
      record?: string(name='Record'),
      subdomain?: string(name='Subdomain'),
      type?: string(name='Type'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListOrgDNSMapResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListOrgDNSMapResponseBody(name='body'),
}

async function listOrgDNSMapWithOptions(request: ListOrgDNSMapRequest, runtime: Util.RuntimeOptions): ListOrgDNSMapResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOrgDNSMap',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOrgDNSMap(request: ListOrgDNSMapRequest): ListOrgDNSMapResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOrgDNSMapWithOptions(request, runtime);
}

model ListOrgDomainsRequest {
  currentPage?: int32(name='CurrentPage'),
  orgId?: int32(name='OrgId'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListOrgDomainsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      domain?: string(name='Domain'),
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      orgId?: int32(name='OrgId'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListOrgDomainsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListOrgDomainsResponseBody(name='body'),
}

async function listOrgDomainsWithOptions(request: ListOrgDomainsRequest, runtime: Util.RuntimeOptions): ListOrgDomainsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOrgDomains',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOrgDomains(request: ListOrgDomainsRequest): ListOrgDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOrgDomainsWithOptions(request, runtime);
}

model ListOrgHostsRequest {
  currentPage?: int32(name='CurrentPage'),
  orgId?: int32(name='OrgId'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListOrgHostsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      hostname?: string(name='Hostname'),
      IP?: string(name='IP'),
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      OS?: string(name='OS'),
      orgId?: int32(name='OrgId'),
      state?: string(name='State'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListOrgHostsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListOrgHostsResponseBody(name='body'),
}

async function listOrgHostsWithOptions(request: ListOrgHostsRequest, runtime: Util.RuntimeOptions): ListOrgHostsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOrgHosts',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOrgHosts(request: ListOrgHostsRequest): ListOrgHostsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOrgHostsWithOptions(request, runtime);
}

model ListOrgPortsRequest {
  currentPage?: int32(name='CurrentPage'),
  orgId?: int32(name='OrgId'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListOrgPortsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      fingerprint?: string(name='Fingerprint'),
      IP?: string(name='IP'),
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      orgId?: int32(name='OrgId'),
      port?: int32(name='Port'),
      product?: string(name='Product'),
      protocol?: string(name='Protocol'),
      service?: string(name='Service'),
      updatedAt?: long(name='UpdatedAt'),
      version?: string(name='Version'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListOrgPortsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListOrgPortsResponseBody(name='body'),
}

async function listOrgPortsWithOptions(request: ListOrgPortsRequest, runtime: Util.RuntimeOptions): ListOrgPortsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOrgPorts',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOrgPorts(request: ListOrgPortsRequest): ListOrgPortsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOrgPortsWithOptions(request, runtime);
}

model ListOrgRiskyAssetsRequest {
  orgId?: int32(name='OrgId'),
}

model ListOrgRiskyAssetsResponseBody = {
  assets?: [ 
    {
      asset?: string(name='Asset'),
      count?: int32(name='Count'),
      type?: string(name='Type'),
    }
  ](name='Assets'),
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  total?: int32(name='Total'),
  totalCount?: int32(name='TotalCount'),
}

model ListOrgRiskyAssetsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListOrgRiskyAssetsResponseBody(name='body'),
}

async function listOrgRiskyAssetsWithOptions(request: ListOrgRiskyAssetsRequest, runtime: Util.RuntimeOptions): ListOrgRiskyAssetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOrgRiskyAssets',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOrgRiskyAssets(request: ListOrgRiskyAssetsRequest): ListOrgRiskyAssetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOrgRiskyAssetsWithOptions(request, runtime);
}

model ListOrgSubdomainsRequest {
  currentPage?: int32(name='CurrentPage'),
  orgId?: int32(name='OrgId'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListOrgSubdomainsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      domain?: string(name='Domain'),
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      orgId?: int32(name='OrgId'),
      subdomain?: string(name='Subdomain'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListOrgSubdomainsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListOrgSubdomainsResponseBody(name='body'),
}

async function listOrgSubdomainsWithOptions(request: ListOrgSubdomainsRequest, runtime: Util.RuntimeOptions): ListOrgSubdomainsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOrgSubdomains',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOrgSubdomains(request: ListOrgSubdomainsRequest): ListOrgSubdomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOrgSubdomainsWithOptions(request, runtime);
}

model ListOrgVulFacetsRequest {
  asset?: string(name='Asset'),
  currentPage?: int32(name='CurrentPage'),
  lang?: string(name='Lang'),
  orgId?: int32(name='OrgId'),
  pageSize?: int32(name='PageSize'),
}

model ListOrgVulFacetsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  total?: int32(name='Total'),
  totalCount?: int32(name='TotalCount'),
  vuls?: [ 
    {
      classification?: string(name='Classification'),
      count?: int32(name='Count'),
      index?: int32(name='Index'),
      moduleID?: int32(name='ModuleID'),
      name?: string(name='Name'),
      severity?: string(name='Severity'),
    }
  ](name='Vuls'),
}

model ListOrgVulFacetsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListOrgVulFacetsResponseBody(name='body'),
}

async function listOrgVulFacetsWithOptions(request: ListOrgVulFacetsRequest, runtime: Util.RuntimeOptions): ListOrgVulFacetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asset)) {
    query['Asset'] = request.asset;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOrgVulFacets',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOrgVulFacets(request: ListOrgVulFacetsRequest): ListOrgVulFacetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOrgVulFacetsWithOptions(request, runtime);
}

model ListOrgWebPathsRequest {
  currentPage?: int32(name='CurrentPage'),
  orgId?: int32(name='OrgId'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListOrgWebPathsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      orgId?: int32(name='OrgId'),
      path?: string(name='Path'),
      site?: string(name='Site'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListOrgWebPathsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListOrgWebPathsResponseBody(name='body'),
}

async function listOrgWebPathsWithOptions(request: ListOrgWebPathsRequest, runtime: Util.RuntimeOptions): ListOrgWebPathsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOrgWebPaths',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOrgWebPaths(request: ListOrgWebPathsRequest): ListOrgWebPathsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOrgWebPathsWithOptions(request, runtime);
}

model ListOrgWebTechsRequest {
  currentPage?: int32(name='CurrentPage'),
  orgId?: int32(name='OrgId'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListOrgWebTechsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      name?: string(name='Name'),
      orgId?: int32(name='OrgId'),
      poweredBy?: string(name='PoweredBy'),
      server?: string(name='Server'),
      title?: string(name='Title'),
      URL?: string(name='URL'),
      updatedAt?: long(name='UpdatedAt'),
      version?: string(name='Version'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListOrgWebTechsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListOrgWebTechsResponseBody(name='body'),
}

async function listOrgWebTechsWithOptions(request: ListOrgWebTechsRequest, runtime: Util.RuntimeOptions): ListOrgWebTechsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOrgWebTechs',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOrgWebTechs(request: ListOrgWebTechsRequest): ListOrgWebTechsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOrgWebTechsWithOptions(request, runtime);
}

model ListUserAttackSurfaceFacetsResponseBody = {
  DNSMap?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='DNSMap'),
  domains?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='Domains'),
  hosts?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='Hosts'),
  ports?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='Ports'),
  requestId?: string(name='RequestId'),
  subdomains?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='Subdomains'),
  webPaths?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='WebPaths'),
  webTechs?: {
    new?: int32(name='New'),
    total?: int32(name='Total'),
  }(name='WebTechs'),
}

model ListUserAttackSurfaceFacetsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUserAttackSurfaceFacetsResponseBody(name='body'),
}

async function listUserAttackSurfaceFacetsWithOptions(runtime: Util.RuntimeOptions): ListUserAttackSurfaceFacetsResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListUserAttackSurfaceFacets',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUserAttackSurfaceFacets(): ListUserAttackSurfaceFacetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserAttackSurfaceFacetsWithOptions(runtime);
}

model ListUserDNSMapRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListUserDNSMapResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      domain?: string(name='Domain'),
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      record?: string(name='Record'),
      subdomain?: string(name='Subdomain'),
      type?: string(name='Type'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListUserDNSMapResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUserDNSMapResponseBody(name='body'),
}

async function listUserDNSMapWithOptions(request: ListUserDNSMapRequest, runtime: Util.RuntimeOptions): ListUserDNSMapResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserDNSMap',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUserDNSMap(request: ListUserDNSMapRequest): ListUserDNSMapResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserDNSMapWithOptions(request, runtime);
}

model ListUserDomainsRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListUserDomainsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      domain?: string(name='Domain'),
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListUserDomainsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUserDomainsResponseBody(name='body'),
}

async function listUserDomainsWithOptions(request: ListUserDomainsRequest, runtime: Util.RuntimeOptions): ListUserDomainsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserDomains',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUserDomains(request: ListUserDomainsRequest): ListUserDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserDomainsWithOptions(request, runtime);
}

model ListUserHostsRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListUserHostsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      hostname?: string(name='Hostname'),
      IP?: string(name='IP'),
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      OS?: string(name='OS'),
      state?: string(name='State'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListUserHostsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUserHostsResponseBody(name='body'),
}

async function listUserHostsWithOptions(request: ListUserHostsRequest, runtime: Util.RuntimeOptions): ListUserHostsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserHosts',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUserHosts(request: ListUserHostsRequest): ListUserHostsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserHostsWithOptions(request, runtime);
}

model ListUserOrganizationsRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListUserOrganizationsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  organizations?: [ 
    {
      createdAt?: long(name='CreatedAt'),
      description?: string(name='Description'),
      index?: int32(name='Index'),
      name?: string(name='Name'),
      orgId?: int32(name='OrgId'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Organizations'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListUserOrganizationsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUserOrganizationsResponseBody(name='body'),
}

async function listUserOrganizationsWithOptions(request: ListUserOrganizationsRequest, runtime: Util.RuntimeOptions): ListUserOrganizationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserOrganizations',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUserOrganizations(request: ListUserOrganizationsRequest): ListUserOrganizationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserOrganizationsWithOptions(request, runtime);
}

model ListUserPortsRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListUserPortsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      fingerprint?: string(name='Fingerprint'),
      IP?: string(name='IP'),
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      port?: int32(name='Port'),
      product?: string(name='Product'),
      protocol?: string(name='Protocol'),
      service?: string(name='Service'),
      updatedAt?: long(name='UpdatedAt'),
      version?: string(name='Version'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListUserPortsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUserPortsResponseBody(name='body'),
}

async function listUserPortsWithOptions(request: ListUserPortsRequest, runtime: Util.RuntimeOptions): ListUserPortsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserPorts',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUserPorts(request: ListUserPortsRequest): ListUserPortsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserPortsWithOptions(request, runtime);
}

model ListUserSubdomainsRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListUserSubdomainsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      domain?: string(name='Domain'),
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      subdomain?: string(name='Subdomain'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListUserSubdomainsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUserSubdomainsResponseBody(name='body'),
}

async function listUserSubdomainsWithOptions(request: ListUserSubdomainsRequest, runtime: Util.RuntimeOptions): ListUserSubdomainsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserSubdomains',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUserSubdomains(request: ListUserSubdomainsRequest): ListUserSubdomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserSubdomainsWithOptions(request, runtime);
}

model ListUserWebPathsRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListUserWebPathsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      path?: string(name='Path'),
      site?: string(name='Site'),
      updatedAt?: long(name='UpdatedAt'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListUserWebPathsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUserWebPathsResponseBody(name='body'),
}

async function listUserWebPathsWithOptions(request: ListUserWebPathsRequest, runtime: Util.RuntimeOptions): ListUserWebPathsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserWebPaths',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUserWebPaths(request: ListUserWebPathsRequest): ListUserWebPathsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserWebPathsWithOptions(request, runtime);
}

model ListUserWebTechsRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  search?: string(name='Search'),
}

model ListUserWebTechsResponseBody = {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  records?: [ 
    {
      id?: int32(name='Id'),
      index?: int32(name='Index'),
      name?: string(name='Name'),
      poweredBy?: string(name='PoweredBy'),
      server?: string(name='Server'),
      title?: string(name='Title'),
      URL?: string(name='URL'),
      updatedAt?: long(name='UpdatedAt'),
      version?: string(name='Version'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListUserWebTechsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUserWebTechsResponseBody(name='body'),
}

async function listUserWebTechsWithOptions(request: ListUserWebTechsRequest, runtime: Util.RuntimeOptions): ListUserWebTechsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserWebTechs',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUserWebTechs(request: ListUserWebTechsRequest): ListUserWebTechsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserWebTechsWithOptions(request, runtime);
}

model ModifyOrganizationRequest {
  description?: string(name='Description'),
  name?: string(name='Name'),
  orgId?: int32(name='OrgId'),
}

model ModifyOrganizationResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyOrganizationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyOrganizationResponseBody(name='body'),
}

async function modifyOrganizationWithOptions(request: ModifyOrganizationRequest, runtime: Util.RuntimeOptions): ModifyOrganizationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyOrganization',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyOrganization(request: ModifyOrganizationRequest): ModifyOrganizationResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyOrganizationWithOptions(request, runtime);
}

model TagAssetsByRecordsRequest {
  assetType?: string(name='AssetType'),
  recordIds?: [ int32 ](name='RecordIds'),
  source?: string(name='Source'),
  tags?: [ string ](name='Tags'),
}

model TagAssetsByRecordsResponseBody = {
  requestId?: string(name='RequestId'),
}

model TagAssetsByRecordsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: TagAssetsByRecordsResponseBody(name='body'),
}

async function tagAssetsByRecordsWithOptions(request: TagAssetsByRecordsRequest, runtime: Util.RuntimeOptions): TagAssetsByRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.assetType)) {
    query['AssetType'] = request.assetType;
  }
  if (!Util.isUnset(request.recordIds)) {
    query['RecordIds'] = request.recordIds;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TagAssetsByRecords',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function tagAssetsByRecords(request: TagAssetsByRecordsRequest): TagAssetsByRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagAssetsByRecordsWithOptions(request, runtime);
}

model TagAssetsBySearchRequest {
  assetType?: string(name='AssetType'),
  search?: string(name='Search'),
  source?: string(name='Source'),
  tags?: [ string ](name='Tags'),
}

model TagAssetsBySearchResponseBody = {
  requestId?: string(name='RequestId'),
}

model TagAssetsBySearchResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: TagAssetsBySearchResponseBody(name='body'),
}

async function tagAssetsBySearchWithOptions(request: TagAssetsBySearchRequest, runtime: Util.RuntimeOptions): TagAssetsBySearchResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.assetType)) {
    query['AssetType'] = request.assetType;
  }
  if (!Util.isUnset(request.search)) {
    query['Search'] = request.search;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TagAssetsBySearch',
    version = '2017-11-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function tagAssetsBySearch(request: TagAssetsBySearchRequest): TagAssetsBySearchResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagAssetsBySearchWithOptions(request, runtime);
}

